package vip.xiaomaoxiaoke.joinbymemory.annotation;

import org.intellij.lang.annotations.Language;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
 * 使用案例
 * @JoinByMemory(mainKey = "#{poiId}",
 *       mainKeys = "#{poiId}+':'+#{poiType}",
 *       outKey = "#{id}",
 *       outKeys =  "#{id}+':'+#{type}",
 *       loader = "#{@vFacilitiesService.listByField(#root,'id')}",
 *       joinDataConverter = "#{#root.name}"
 * )
 * */

@Target({ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface JoinByMemory {

    /**
     * 主类的查询键
     * */
    String mainKey();

    /**
     * 主类的匹配键
     * */
    String mainKeys() default "";

    String outKey();

    String outKeys() default "";

    @Language("SpringEL")
    String loader();

    String joinDataConverter() default "";

    int runLevel() default 10;

    String[] group() default {};


}
